/********************************************************************
	TABAL ENGINE - 2012/11/04
	author:		Marc Cuscullola
	
	purpose:	Defines a technique contained in an effect
*********************************************************************/
#pragma once

#ifndef __GRAPHICS__EFFECT_TECHNIQUE__INCLUDED_H__
#define __GRAPHICS__EFFECT_TECHNIQUE__INCLUDED_H__

#pragma warning (disable:4005)

#include "MathTypes.h"
#include "d3dx11effect.h"
#include <d3dx11.h>
#include <string>
#include <vector>
#include <map>

class CXMLTreeNode;
class CEffect;

class CEffectTechnique
{
public:
	CEffectTechnique(CXMLTreeNode& _node);
	~CEffectTechnique();

	void BeginRender();

	const std::string&		GetTechniqueName() const;
	ID3DX11EffectTechnique* GetD3DTechnique() { return m_pTechnique; }
	ID3D11InputLayout*		GetInputLayout(ID3DX11EffectPass* _pass);
	ID3D11InputLayout*		GetInput() { return m_InputLayoutVector[0]; }

private:
	void	GetTechniqueByEffect();
	void	CreateInputsLayouts();

private:
	ID3DX11EffectTechnique* m_pTechnique;

	CEffect*	m_pEffect;       
	std::string m_sTechniqueName;

	std::map<ID3DX11EffectPass*, ID3D11InputLayout*> m_InputLayoutMap;
	std::vector<ID3D11InputLayout*> m_InputLayoutVector;

	bool		m_bUseWorldMatrix;
	bool		m_bUseViewMatrix;
	bool		m_bUse2DViewMatrix;
	bool		m_bUseProjectionMatrix;
	bool		m_bUseOrthographicMatrix;
	bool		m_bUseViewProjectionMatrix;
	uint8		m_uUseTextures;
};

#endif //__GRAPHICS__EFFECT_TECHNIQUE__INCLUDED_H__
